package com.jcl.recruit.channel.logic;

import com.jcl.core.constants.Constant;
import com.jcl.recruit.channel.dao.ChannelNetDao;
import com.jcl.recruit.channel.model.ChannelNet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName ChannelNetLogic

 * @Author yyliu
 * @Date 2018/9/11 17:08
 * @Version 1.0
 **/
@Component
public class ChannelNetLogic {

    @Autowired
    private ChannelNetDao channelNetDao;

    public List<ChannelNet> findList(String corpCode,
                                     String account,
                                     String channelType) {
        return channelNetDao.findList(corpCode, account, channelType, null);
    }

    public List<ChannelNet> findList(String corpCode,
                                     String account,
                                     String channelType,
                                     Integer status) {
        return channelNetDao.findList(corpCode, account, channelType, status);
    }

    public List<ChannelNet> findListByActive(String corpCode,
                                             String channelType) {
        return channelNetDao.findList(corpCode, null, channelType, Constant.NUMBER_1);
    }

    public List<ChannelNet> selectList(String corpCode,
                                       String userId) {
        return channelNetDao.selectList(corpCode, userId);
    }

    public ChannelNet findOneByAccountNo(String corpCode,
                                         String accountNo) {
        return channelNetDao.findOneByAccountNo(corpCode, accountNo);
    }

    public ChannelNet findOne(String corpCode, Integer id) {
        return channelNetDao.findOne(corpCode, id);
    }

    public int addChannelNet(ChannelNet channelNet) {
        return channelNetDao.addChannelNet(channelNet);
    }

    public int updateChannelNet(ChannelNet channelNet) {
        return channelNetDao.updateChannelNet(channelNet);
    }

    public int deleteChannelNet(String corpCode,
                                Integer id,
                                Integer status) {
        return channelNetDao.deleteChannelNet(corpCode, id, status);
    }


}
